package com.wsp.service.mapper;

import com.wsp.apimanagement.pojo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * Package: com.wsp.service.mapper
 * Description： TODO
 *
 * @Author: 巫思平
 * Copyright: Copyright (c) 2020
 * Version: 1
 */
@Repository
@Mapper
public interface UserMapper {
    /**
     * 通过openId查找用户
     * @param openId
     * @return
     */
    User findUserByOpenId(String openId);

    /**
     * 通过用户id查找用户
     * @param userId
     * @return
     */
    User findUserByUserId(long userId);

    /**
     * 新增用户
     * @param openId 用户openId
     * @param userName 用户名
     * @param userAvatar 用户头像
     * @return
     */
    Integer insertUser(String openId, String userName, String userAvatar);
}
